package com.cyan.note.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 客户管理实体类
 * 对应数据库表: customers
 * 
 * @author ZhangzhenYu
 * @since 2025-01-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Customer extends BaseEntity {

    /**
     * 所属店铺ID
     */
    private Long shopId;

    /**
     * 客户昵称
     */
    private String nickname;

    /**
     * 真实姓名
     */
    private String realName;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 性别
     */
    private String gender;

    /**
     * 生日
     */
    private LocalDate birthday;

    /**
     * 头像URL
     */
    private String avatar;

    /**
     * 客户状态
     */
    private String status;

    /**
     * 客户等级
     */
    private String level;

    /**
     * 省份
     */
    private String regionProvince;

    /**
     * 城市
     */
    private String regionCity;

    /**
     * 区县
     */
    private String regionDistrict;

    /**
     * 详细地址
     */
    private String address;

    /**
     * 客户来源
     */
    private String source;

    /**
     * 推荐人客户ID
     */
    private Long referrerCustomerId;

    /**
     * 账户余额
     */
    private BigDecimal accountBalance;

    /**
     * 信用额度
     */
    private BigDecimal creditLimit;

    /**
     * 累计消费金额
     */
    private BigDecimal totalConsumption;

    /**
     * 累计订单数
     */
    private Integer totalOrders;

    /**
     * 最后下单时间
     */
    private LocalDateTime lastOrderTime;

    /**
     * 最后登录时间
     */
    private LocalDateTime lastLoginTime;

    /**
     * 客户偏好设置(JSON)
     */
    private String preferences;

    /**
     * 客户备注
     */
    private String notes;

    // 常量定义
    public static class Status {
        public static final String NORMAL = "normal";
        public static final String BLACKLISTED = "blacklisted";
        public static final String DISABLED = "disabled";
    }

    public static class Level {
        public static final String NEW = "new";
        public static final String NORMAL = "normal";
        public static final String SILVER = "silver";
        public static final String GOLD = "gold";
        public static final String VIP = "vip";
    }

    public static class Gender {
        public static final String MALE = "male";
        public static final String FEMALE = "female";
        public static final String UNKNOWN = "unknown";
    }
}